package com.hsj.demo.controller;

import com.hsj.demo.entity.UserNotice;
import com.hsj.demo.service.UserNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/userNotice")
public class UserNoticeController {
    @Autowired
    private UserNoticeService userNoticeService;

    @RequestMapping("/getByUserId")
    public List<UserNotice> getByUserId(Integer id){
        return userNoticeService.getByUserId(id);
    }

    @RequestMapping("/deleteById")
    public Integer deleteById(Integer id){
        return userNoticeService.deleteById(id);
    }

    @RequestMapping("/update")
    public Integer update(UserNotice userNotice){
        return userNoticeService.update(userNotice);
    }
}
